package com.wanlian.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.wanlian.json.MyTimestampDeserializer;
import com.wanlian.util.DateUtil;
import org.hibernate.validator.constraints.NotEmpty;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

@Entity
@Table(name = "tb_questiontype")
public class QuestionType {
	@Id
	@GeneratedValue
	private int id;
	@Column(name = "mname")
	@NotEmpty(message = "类别名称不能为空！")
	private String modelName;
	@Column(name = "mdesc")
	private String modelDesc;
	@Column(name = "lastupdatetime")
	@JsonDeserialize(using = MyTimestampDeserializer.class)
	private Timestamp lastUpdateTime;
	@Column(name = "oindex")
	private int orderIndex;
	@Column(name = "isenable")
	private boolean isEnable;

	public QuestionType() {
		this.lastUpdateTime=DateUtil.currentTimestamp();
		this.isEnable=true;
	}

	public boolean isEnable() {
		return isEnable;
	}

	public void setEnable(boolean enable) {
		isEnable = enable;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getModelName() {
		return modelName;
	}

	public void setModelName(String modelName) {
		this.modelName = modelName;
	}

	public String getModelDesc() {
		return modelDesc;
	}

	public void setModelDesc(String modelDesc) {
		this.modelDesc = modelDesc;
	}

	public Timestamp getLastUpdateTime() {
		return lastUpdateTime;
	}

	public void setLastUpdateTime(Timestamp lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

	public int getOrderIndex() {
		return orderIndex;
	}

	public void setOrderIndex(int orderIndex) {
		this.orderIndex = orderIndex;
	}

}
